Repository navigation
fix(ci): bound the narrowed test workers and their collection - #5614
Conversation
The collection that counts the tests of a narrowed `devops ci test` run exited 1 when a selected module had snapshots, because a collection runs no test and syrupy found each snapshot unused. The run then went back to the file count, so the 7 modules of #4472 still ran with `-n 0`. The collection now gives `--snapshot-warn-unused`. The run gave an explicit `-n 4`, which skips `PYTEST_XDIST_AUTO_NUM_WORKERS`, so a runner pod with 1 CPU ran 4 workers. The run now starts at most the value of that variable, and a bound of 1 runs serially with no collection. More than 50 target modules with no `-k` filter also make no collection. The collection has its own timeout of 120 s, and its warning prints as text. On 1 CPU, a narrowed run of a 52-test module took 37 s before and 8 s after.
The process fake now must receive DEFAULT_CI_TEST_COLLECTION_TIMEOUT_SECONDS for the collection. The timeout case only read the reason text, so a collection with the 1800 s timeout of the run passed it. The knowledge-base page also names the second skip of the collection (#5606).
Test results (local, head 6e21f7d on origin/main b15faab)Real collection of the #4472 selection (7 modules):
Fail-to-pass: Timing of one narrowed 52-test run (
#5612 tracks the cost of 4 workers for a module of fast tests. Scoped checks:
Review fix: the timeout case only read the reason text, so a collection with the 1800 s timeout of the run passed it. The new case Render diff: the change touches no path under |
🤖 I have created a release *beep* *boop* --- ## [0.136.2](v0.136.1...v0.136.2) (2026-11-14) ### Bug Fixes * **ci:** bound the narrowed test workers and their collection ([#5614](#5614)) ([1430ab8](1430ab8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
The fix of #4472 counts the tests of a narrowed
devops ci testrun with a second pytest session, but three defects stopped it. syrupy made that collection exit 1 for the unused snapshots of a selected module, so the run went back to the file count. The run gave an explicit-n 4, and xdist does not bound that withPYTEST_XDIST_AUTO_NUM_WORKERS, so a runner pod with 1 CPU ran 4 workers. Each narrowed run also started the collection, with the 1800 s timeout of the run.The collection now gives
--snapshot-warn-unused. The worker cap is the smaller of 4 andPYTEST_XDIST_AUTO_NUM_WORKERS. A cap of 1 runs serially, and more than 50 target modules with no-kfilter run on the cap. Both make no collection. The collection has its own timeout of 120 s, and its warning prints the command as text. The documents state the new rule.Closes #5606
Change:
openspec/changes/archive/2026-11-14-5606-narrowed-test-workers-fall-back-and/